package com.zmn.plat.admin.controller.supplier;

import java.util.List;

import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.zmn.common.dto.LayuiTableResponseDTO;
import com.zmn.plat.model.entity.supplier.ScmSupplierQuery;
import com.zmn.plat.model.entity.supplier.ScmSupplierVO;

/**
 * @author DaiZhichao
 * @version v1.0
 * @since 2018/10/26 19:36 类说明：ScmSupplierListController
 */

@RestController
@RequestMapping("/supplier/ajax")
public class ScmSupplierAjaxController extends ScmSupplierBaseController {
    private Logger logger = LoggerFactory.getLogger(ScmSupplierAjaxController.class);

    /**
     * 描述: [Layui] 加载数据表格 普通配件
     *
     * @author DaiZhichao
     * @since 2018/11/6 20:59
     */
    @RequestMapping(value = "/list", produces = "application/json; charset=utf-8")
    @RequiresPermissions("/supplier/list.action")
    public LayuiTableResponseDTO supplierCompanyList(ScmSupplierQuery query) {

        List<ScmSupplierVO> scmSupplierList = scmSupplierService.listVOPageByQuery(query);

        Integer count = scmSupplierService.countByQuery(query);
        return LayuiTableResponseDTO.success(count, scmSupplierList);
    }

}
